package com.yunfeng.web.util;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Result<T> implements Serializable {
    private static final long serialVersionUID = 1L;
    private int ReturnCode;
    private String ReturnMemo;
    private List<T> data;

    public Result() {
    }

    public Result(int ReturnCode, String ReturnMemo) {
        this.ReturnCode = ReturnCode;
        this.ReturnMemo = ReturnMemo;
    }

    public int getReturnCode() {
		return ReturnCode;
	}

	public void setReturnCode(int returnCode) {
		ReturnCode = returnCode;
	}

	public String getReturnMemo() {
		return ReturnMemo;
	}

	public void setReturnMemo(String returnMemo) {
		ReturnMemo = returnMemo;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public List<T> getData() {
        return data;
    }


	public void setData(List<T> data) {
        this.data = data;
    }

    public void setData(T data){
        List<T> lists = new ArrayList<>();
        lists.add(data);
        this.data = lists;
    }

    @Override
    public String toString() {
        return "Result{" +
                "ReturnCode=" + ReturnCode +
                ", ReturnMemo='" + ReturnMemo + '\'' +
                ", data=" + data +
                '}';
    }
}
